const path = require("path");
global.DIR_LIBRARY_CONTROLLER = path.normalize(__dirname + "/library/engine/controller");

class Dir{
	constructor(){
		this.app = "application";
		this.controll = "controller";
		this.view = "view";
		this.config = "application/config";
		this.appname = false;
		this.data = "data";
		this.image = "data/images";
		this.public = "public";
		this.root = __dirname;
	}
	get(name){
		return this[name] ? this[name] : "";
	}
	set(name,value){
		this[name] = value;
		return this[name];
	}
}

let dir = new Dir();
module.exports = {
	dir:{
		get:function(name){
			return dir.get(name);
		},
		set:function(name, value){
			return dir.set(name, value);
		}
	},  
	server:{
		hostname:'127.0.0.1',
		port:88
	},
	db:{
		hostname: "localhost",
		port: 3306,
		username: "root",
		password: "",
		db_name: "test",
		db_prefix: ""
	},
	router:{
		default:{
			module: "main",
			controll: "index",
			action: "index"
		},
		error:{
			"404": {
				module: "error",
				controll: "notfound",
				action: "index"
			}
		},
		route:{}
	},
	apps:{
		default:"catalog",
		list:{
			admin:"admin"
		}
	}
}